/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.site.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 文章Entity
 * @author ben
 * @version 2018-05-09
 */
@Table(name="${_prefix}site_article", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="title", attrName="title", label="标题", queryType=QueryType.LIKE),
		@Column(name="desc", attrName="desc", label="简介"),
		@Column(name="content", attrName="content", label="内容"),
		@Column(name="author", attrName="author", label="作者"),
		@Column(name="source", attrName="source", label="来源"),
		@Column(name="createtime", attrName="createtime", label="创建时间"),
		@Column(name="category", attrName="category", label="栏目"),
		@Column(name="thumbnail", attrName="thumbnail", label="缩略图"),
		@Column(name="flag", attrName="flag", label="flag"),
	}, orderBy="a.id DESC"
)
public class SiteArticle extends DataEntity<SiteArticle> {
	
	private static final long serialVersionUID = 1L;
	private String title;		// 标题
	private String desc;		// 简介
	private String content;		// 内容
	private String author;		// 作者
	private String source;		// 来源
	private Date createtime;		// 创建时间
	private Integer category;		// 栏目
	private String thumbnail;		// 缩略图
	private Integer flag;		// flag
	
	public SiteArticle() {
		this(null);
	}

	public SiteArticle(String id){
		super(id);
	}
	
	@Length(min=0, max=100, message="标题长度不能超过 100 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@Length(min=0, max=255, message="简介长度不能超过 255 个字符")
	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@Length(min=0, max=20, message="作者长度不能超过 20 个字符")
	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}
	
	@Length(min=0, max=20, message="来源长度不能超过 20 个字符")
	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	
	public Integer getCategory() {
		return category;
	}

	public void setCategory(Integer category) {
		this.category = category;
	}
	
	public String getThumbnail() {
		return thumbnail;
	}

	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}
	
	public Integer getFlag() {
		return flag;
	}

	public void setFlag(Integer flag) {
		this.flag = flag;
	}
	
}